package com.hbnu.system.controller;



import com.hbnu.system.core.base.Rest;
import com.hbnu.system.model.entity.Zxxk;
import com.hbnu.system.service.ZxxkService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 纵向学科类别(Zxxk)表控制层
 *
 * @author makejava
 * @since 2024-12-21 21:31:02
 */
@RestController
@RequestMapping("/Zxxk")
@Api(tags = "纵向学科模块")
public class ZxxkController {
    @Autowired
    private ZxxkService zxxkService;

    @ApiOperation("纵向学科类别添加")
    @PostMapping("/addZxxk")
    public Rest<Boolean> addZxxk(@RequestBody Zxxk zxxk){
        boolean add = zxxkService.addZxxk(zxxk);
        return add ? Rest.success() : Rest.failed();
    }

    @ApiOperation("纵向学科类别删除")
    @GetMapping("/deletePaperQulification")
    public Rest<Boolean> deletePaperQulification(String ZxxkID){
        boolean delete = zxxkService.deleteZxxk(ZxxkID);
        return delete ? Rest.success() : Rest.failed();
    }

    @ApiOperation("纵向学科类别查看")
    @GetMapping("/getPaperQulification")
    public Rest<List<Zxxk>> getPaperQulification(){
        List<Zxxk> onePaper_qualification = zxxkService.getOneZxxk();

        return Rest.success(onePaper_qualification);
    }
}

